<template>
	<div class="card-page">


		<el-row :gutter="12" type="flex">
			<el-col :span="12">
				<el-card shadow="always">

                    <template #header v-if="title"> <span>{{title}}</span> </template>
					<kv label="序号">
						<el-input v-model="info.index" />
					</kv>
					<kv label="编码">
						<el-input v-model="info.code" />
					</kv>
					<kv label="名称">
						<el-input v-model="info.name" chk="*" />
					</kv>
				</el-card>
			</el-col>

		</el-row>
	</div>
</template>
<style scoped lang="scss">
</style>
<script setup>
/**
 * Created by CodeGenerator  at 2022-06-09 17:53:00
 */




//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({"info":{}});
const info = $computed(()=> $data.info );

const $props = defineProps({
    id: { type: String } ,
    action: { type: String } ,
    title : { type: String }
});

const action_name = $computed(()=>{
    return {add: "添加", edit: "修改"}[$props.action]
});
const $model = defineModel({ type: Object });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);







watch($model, function(v) {
    if( $data.info == v) return;
    $data.info = v;
} ,{ immediate:true });
watch(info, function(v) {
    if( $data.info == v) return;
    $emit("update:modelValue",v)
} ,{ immediate:true });

</script>
